

<div class="mws-panel grid_8 branches form">

<div class="mws-panel-header"><span class="mws-i-24 i-table-1"><?php echo __('Add Branch'); ?></span>
</div>

<div class="mws-panel-body">


<div class="e_right" style="margin: 10px;"><?php 
//foreach ($stages as $key=>$value) {
//	echo  $this->Html->link($value, array('action' => 'add',$key),array("class"=>"e_right mws-button red mws-i-24 i-books large f_large","style"=>"width:220px")); //<input type="button" class="mws-button red mws-i-24 i-cog large" value="Red">
//	echo '<div class="clear" ></div>';
//}
//debug($stages_branche);
?></div>

<div class="mws-panel grid_8">
<div class="mws-tabs ui-tabs ui-widget ui-widget-content ui-corner-all">

<ul
	class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">

	<?php
	 
	$branches_parents=array();
	$branches_child=array();
	$i=0;
	foreach ($stages_branche as $key=>$value) {
		//$branches_child[$stages["Stage"]["level"]]=$value["name"];
		if(!$i)
		echo  '<li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active f_medium"><a href="#tab-'.$value["Stage"]["id"].'">'.$value["Stage"]["name"].'</a></li>';//$this->Html->link($value, array('action' => 'add',$key),array("class"=>"e_right mws-button red mws-i-24 i-books large f_large","style"=>"width:220px")); //<input type="button" class="mws-button red mws-i-24 i-cog large" value="Red">
		else
		echo  '<li class="ui-state-default ui-corner-top f_medium"><a href="#tab-'.$value["Stage"]["id"].'">'.$value["Stage"]["name"].'</a></li>';
		$i++;
	}?>


</ul>
	<?php
	foreach ($stages_branche as $stages) {
		 echo  '<div id="tab-'.$stages["Stage"]["id"].'" class="ui-tabs-panel ui-widget-content ui-corner-bottom"> ';//$this->Html->link($value, array('action' => 'add',$key),array("class"=>"e_right mws-button red mws-i-24 i-books large f_large","style"=>"width:220px")); //<input type="button" class="mws-button red mws-i-24 i-cog large" value="Red">
		?> 
 
		<?php 
foreach ($stages["Branch"] as $value) {
	
	$branches_parents[$stages["Stage"]["level"]][$value["id"]]=$value["name"];
	
}
if(!empty($branches_parents[$stages["Stage"]["level"]])){
?>
<div class="e_right" style="margin: 10px;"><?php 
foreach ($stages["Branch"]  as $key=>$value) {
	
	echo  "<div class='e_right mws-button blue mws-i-24 i-books large f_large ' style='width:420px; color=#FFFFFF'>".
	$this->Html->link($value["name"], array('action' => 'add',$value["id"]),array("class"=>"e_right","style"=>"color:#FFFF00"));
	echo  "<div class='actions e_left' style='width:220px'>";
    echo $this->Html->link(__('View')." ", array('action' => 'view', $value["id"]),array("class"=>"mws-ic-16 ic-view f_medium","style"=>"color:#FFFFFF")); 
	echo $this->Html->link(__('Edit')." ", array('action' => 'edit', $value["id"]),array("class"=>"mws-ic-16 ic-hammer-screwdriver f_medium","style"=>"color:#FFFFFF")); 
	echo $this->Form->postLink(__('Delete')." ", array('action' => 'delete', $value["id"]), array("class"=>"mws-ic-16 ic-cross f_medium","style"=>"color:#FFFFFF"), __('Are you sure you want to delete # %s?', $value["id"])); 
	echo "</div>";
	
	echo "</div>"; //<input type="button" class="mws-button red mws-i-24 i-cog large" value="Red">
	
	echo '<div class="clear" ></div>';
}
 
?></div>
 

 


<div class="clear" ></div>
<?php 
}else{echo '<div class="mws-form-message info f_large" id="flashMessage">لا يوجد شعب فى هذه الفرقة </div>';}  ?>
</div>


<?php }?>

</div>
</div>
 <div class="clear" ></div> 
</div>
</div>
 
 
